{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# The MarketDataPattern class allows the user to select a collection of observable market data\n",
    "# MarketDataPattern arguments include: mkt_type, mkt_asset, mkt_class, mkt_point and mkt_quoting_style\n",
    "from gs_quant.risk import MarketDataPattern"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "# A MarketDataPattern defined with 'IR Vol' mkt_type contains market data related to implied volatility for \n",
    "# IR Swaptions/Caplets\n",
    "ir_vol = MarketDataPattern(mkt_type='IR_Vol')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "# The collection of 'IR Vol' market data can be further constrained by setting the'mkt_asset'\n",
    "# For data with mkt_type 'IR Vol', the mkt_asset is a benchmark rate\n",
    "ir_vol_eur_euribor = MarketDataPattern(mkt_type='IR Vol', mkt_asset='EUR-EURIBOR-TELERATE')\n",
    "ir_vol_gbp_libor = MarketDataPattern('IR Vol', 'GBP-LIBOR-BBA')\n",
    "ir_vol_chf_libor = MarketDataPattern('IR Vol', 'CHF-LIBOR-BBA')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "# Additionally we can select subset of curve instruments using the 'mkt_class'\n",
    "# valid mkt_classes for 'IR Vol' data are 'swaption' and 'caplet' \n",
    "ir_vol_gbp_libor_swaption = MarketDataPattern(mkt_type = 'IR Vol', mkt_asset = 'GBP-LIBOR-BBA', mkt_class ='swaption')\n",
    "ir_vol_gbp_libor_caplet = MarketDataPattern('IR Vol', 'GBP-LIBOR-BBA', 'caplet')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}